'''
Created on 2024年7月19日

@author: Administrator
'''
alien_0 = {'color':'green','points':5}
print(alien_0['color'])
print(alien_0['points'])
print(alien_0)

alien_0['x_position'] = 0
alien_0['y_position'] = 25
print(alien_0)

a = {}
print(a)
a['a'] = 10
# a.a=10
# print(a.a)
print(a['a'])
a[0] = 100
print(a[0])

favorite_languages = {
    'jen':'python',
    'sarah':'c',
    'edward':'rust',
    'phil':'python'
}

for name in favorite_languages:
    print(name)

print(favorite_languages.items())

friends = ['phil','sarah']
for name in favorite_languages.keys():
    print(f'Hi {name.title()}')
    if name in friends:
        language = favorite_languages[name].title()
        print(f'\t{name.title()},I see you love {language}')


for name in sorted(favorite_languages.keys()):
    print(f"{name.title()},thank you for taking the poll")
    
for lang in set(favorite_languages.values()):
    print(lang)

# collection 集合
languages = {'python','rust','python','c'}
print(languages)

print(favorite_languages)
print(set({'a','a','b'}),{'a','a','b'})

